/*
 * ProfileGenerator.hpp
 *
 *  Created on: 8 gru 2013
 *      Author: malwina.kowalczyk
 */

#ifndef PROFILEGENERATOR_HPP_
#define PROFILEGENERATOR_HPP_

#include "common.hpp"
#include <list>
#include "gtest/gtest_prod.h"
#include <memory>

namespace generator
{

class ProfileOutput
{
public:
	virtual void put(const std::vector<dna::profile>&) = 0;
	virtual ~ProfileOutput()
	{
	}
protected:
	ProfileOutput()
	{
	}
};
typedef std::shared_ptr<ProfileOutput> outputPtr;

class ProfileGenerator
{
public:
	ProfileGenerator();

	bool generateAll(
		const std::list<std::list<dna::genotypeSet>>& markersPossibleGenotypeSets, 
		outputPtr resultOutput ,int howManyPeople);
private:
	FRIEND_TEST(ProfileGenerator, shouldGetProperProfilePairForCurrentIndex);
	FRIEND_TEST(ProfileGenerator, shouldGetProperTripleForCurrentIndex);
	std::vector<dna::profile> getProfileTupleForCurrentIndex(
		const std::list<std::list<dna::genotypeSet>>& markersPossibleGenotypeSets, 
		const std::vector<std::list<dna::profile>::const_iterator>& indexes,
		int howManyPeople);
	
	bool increaseIndex(
		std::vector<std::list<dna::profile>::const_iterator>& indexes, 
		const std::vector<std::list<dna::profile>::const_iterator>& end_of_lists, 
		const std::vector<std::list<dna::profile>::const_iterator>& begins_of_lists);
	
};
} /* namespace generator */

#endif /*  PROFILEGENERATOR_HPP_ */
